//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Audio/Engine.Audio.h"
#include "Graphics/Engine.Graphics.h"

#include "UI/MetaData/Meta.ForwardDeclaration.h"

namespace Engine
{
namespace Base
{
	namespace EResource
	{
		const type	_UI_BASE			= (type) ( GRAPHICS | 0x02000000 );
		const type	UI_FRAME			= (type) ( _UI_BASE + 1 );
		const type	UI_LOCALE			= (type) ( _UI_BASE + 2 );
		const type	UI_LOCALE_SETTINGS	= (type) ( _UI_BASE + 3 );
	}
}	// Base


namespace UI
{
	using namespace Base;

	
	class Widget;
	class Frame;
	class Screen;
	class IFrameAnimation;

	SHARED_POINTER( Widget );
	SHARED_POINTER( Screen );
	SHARED_POINTER( Frame );
	SHARED_POINTER( IFrameAnimation );
	


	//
	// Text Align
	//

	namespace ETextAlign
	{
		enum type
		{
			NONE		= 0,
			
			LEFT		= ext_string::EAlign::LEFT,
			CENTER_X	= ext_string::EAlign::CENTER_X,
			RIGHT		= ext_string::EAlign::RIGHT,
			_HORIZONTAL	= LEFT | CENTER_X | RIGHT,

			TOP			= ext_string::EAlign::TOP,
			CENTER_Y	= ext_string::EAlign::CENTER_Y,
			BOTTOM		= ext_string::EAlign::BOTTOM,
			_VERTICAL	= TOP | CENTER_Y | BOTTOM,

			CENTER		= CENTER_X | CENTER_Y,
		};

		UX_ENUM_BIT_OPERATIONS( type );
	}


	//
	// Dock
	//

	namespace EDock
	{
		using namespace ETextAlign;

		const type	FILL = CENTER;
	}

	namespace EAlign
	{
		using namespace ETextAlign;

		const type	DEFAULT	= LEFT | TOP;
	}


	//
	// Animation
	//
	
	struct EAnimation
	{
		enum type
		{
			NONE	= 0,
			ROLL,
			SLIDE,
		};
	};


	//
	// Layout
	//

	struct ELayout
	{
		enum type
		{
			VERTICAL		= 0,
			HORIZONTAL		= 1,
			_COUNT,

			DEFAULT			= VERTICAL,
		};

		enum bits
		{
			VERTICAL_BIT	= 1 << VERTICAL,
			HORIZONTAL_BIT	= 1 << HORIZONTAL,
			ALL_BITS		= 0xFF,
		};
	};


	//
	// Measure Type
	//

	struct EMeasure
	{
		enum type
		{
			// for widgets - used design measure defined in Frame class.
			// for Frame class - used default value.
			AUTO	= 0,

			// all coords converted to normalized coords (-1..+1),
			// widgets will be stretched.
			// (example: quad -> rectangle, circle -> elipse)
			RELATIVE,

			// all coords converted to normalized coords (-1..+1),
			// widget sizes proportionaly scaled without stretching.
			// (exaple: quad -> quad, circle -> circle)
			RELATIVE_PROPORTIONAL,

			// coord not scaled or stretched,
			// pixel coords not changed for other screen resolutions
			ABSOLUTE_IN_PIXELS,

			// coord not scaled or stretched,
			// dips coords not changed for other screen dips,
			// but this coords in pixels may be changed
			ABSOLUTE_IN_DIPS,

			ABSOLUTE	= ABSOLUTE_IN_DIPS,

			// must not be AUTO
			DEFAULT		= RELATIVE,
		};
	};


}	// UI
}	// Engine